// -*- c++ -*-
/**************************************************************/
/*  This file is licensed from, and is a trade secret of:     */
/*                                                            */
/*    Mercury Computer Systems, Incorporated                  */
/*    199 Riverneck Road                                      */
/*    Chelmsford, Massachusetts 01824-2820                    */
/*    United States of America                                */
/*    Telephone + 1 978 256-1300                              */
/*                                                            */
/*  Refer to your Software License Agreement for provisions   */
/*  on use, duplication, or disclosure.                       */
/*  US. Government users and prime contractors are also       */
/*  governed by the following Data Rights Notice:             */
/*  Use, duplication or disclosure by the US. Government is   */
/*  subject to the provisions set forth in FAR 52.227-14 for  */
/*  restricted rights or other agency data rights provisions  */
/*  on commercial software and documentation, as applicable.  */
/*                                                            */
/*  This file: (a) was developed at private expense, and no   */
/*  part was developed with government funds, (b) is a        */
/*  trade secret of Mercury Computer Systems, Inc. for the    */
/*  purposes of the Freedom of Information Act, (c) is        */
/*  "commercial computer software" subject to limited         */
/*  utilization as provided in the above noted Software       */
/*  License Agreement and (d) is in all respects data         */
/*  belonging exclusively to Mercury Computer Systems, Inc..  */
/*                                                            */
/**************************************************************/

/******************************************************************/
/* Copyright (c) 1999-2003, Mercury Computer Systems, Inc.,       */
/* Chelmsford MA.,and all third party embedded software sources.  */
/* All rights reserved under the Copyright laws of US. and        */
/* international treaties.                                        */
/*                                                                */
/* Patent Pending                                                 */
/******************************************************************/


//$COPYRIGHT_END


#ifndef SCEOSSIZECHECK_H__
#define SCEOSSIZECHECK_H__

/*
 * Abstract:
 *
 *     A compile-time "greater than" check that causes a compile-time
 *     error if the check fails. Use as
 *
 *         assert ((compileTimeSizeCheck<i1,i2> ()));
 *
 *     This will throw a "division by zero"  compile-time error if i1 is
 *     less than i2, and compile silently if i1 is greater than or equal
 *     to i2.
 *
 *     Note the extra set parentheses around the expression; this is
 *     to please the preprocessor, which otherwise thinks that '<i1,i2>'
 *     is the less-than operator, and believes that the comma starts
 *     a second parameter to the assert macro.
 *
 */

namespace {

  template<int i>
    int
    sufficientCapacity ()
    {
      return 1;
    }

  template<int i, int j>
    int
    compileTimeSizeCheck ()
    {
      return sufficientCapacity<1 / ((i >= j) ? 1 : 0)> ();
    }

}

#endif
